<template>
  <div v-loading="pageLoading">
    <div class="filter-container">
      <el-input style="width: 300px" placeholder="输入物料号查询按回车" clearable prefix-icon="el-icon-search" class="filter-item"
        @keyup.enter.native="research" @clear="research" v-model="query.queryString"></el-input>
      <el-button class="filter-item" type="success" plain @click="research">查询</el-button>
    </div>
    <z-table :list="list" :tableProps="tableProps" :columns="columns"> </z-table>
    <z-pagination :pagination="pagination" :total="total" :page.sync="query.page" :limit.sync="query.size"
      @change="getList"></z-pagination>
  </div>
</template>

<script>
import commonMixin from '@/views/_common/mixin'
export default {
  mixins: [commonMixin],
  name: 'tab4',
  props: {
    bom_id: {
      type: String,
      default: '',
    },
  },
  watch: {
    bom_id: {
      handler(n, o) {
        if (n) {
          this.query.bom_id = n
          this.getList()
        } else {
          this.list = []
          this.total = 0
        }
      },
      immediate: true,
    },
  },
  data() {
    return {
      tableProps: {
        hideOperations: true,
      },
      api: this.$api.bom,
      query: {
        bom_id: null,
      },
      columns: [
        // {title: 'BOM编码', key: 'bom_no', },
        { title: '物料编码', key: 'key_part_no' },
        { title: '物料名', key: 'key_part_name' },
        { title: '拣料类别', key: 'part_mode' },
        { title: '替代群组', key: 'kp_relation' },
        //{title: 'BOM版本', key: 'bom_version',},
        { title: '数量', key: 'qty' },
        { title: '单位', key: 'unit_mode' },
        { title: '报废率', key: 'wastage_rate' },
        { title: '顺序', key: 'sequence' },
        { title: '系统捡料', key: 'pick_flag' },
        { title: '备注', key: 'remarks' },
        { title: '修改人', key: 'modify_user' },
        { title: '最后修改', key: 'modify_time', width: 150 },
      ],
    }
  },
  created() {
    this.getList()
  },
}
</script>

<style>
</style> 